﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StudentProject.DAL;
using StudentProject.Model;

namespace StudentProject.BLL
{
    public class MajorService
    {
        MajorServiceDal dal = new MajorServiceDal();

        /// <summary>
        /// 打开界面时显示数据
        /// </summary>
        /// <returns></returns>
        public List<Major> GetList()
        {
            return dal.GetLsit();
        }

        //添加数据
        public bool AddInfo(Major major)
        {
            return dal.AddInfo(major)>0;
        }
        
        //修改数据
        public bool UpdateInfo(Major major)
        {
            return dal.UpdateInfo(major) > 0;
        }

        //修改数据(显示)
        public Major LoadUpMajor(string pid)
        {
            return dal.LoadUpMajor(pid);
        }

        //删除数据
        public bool Remove(string pid)
        {
            return dal.Remove(pid)>0;
        }
        
    }
}
